System and method for addressing overfitting in a neural network

ABSTRACT

A system for training a neural network. A switch is linked to feature detectors in at least some of the layers of the neural network. For each training case, the switch randomly selectively disables each of the feature detectors in accordance with a preconfigured probability. The weights from each training case are then normalized for applying the neural network to test data.

CROSS-REFERENCE TO RELATED APPLICATION

This application claims priority to U.S. Provisional Application No.61/745,711, filed on Dec. 24, 2012. The disclosure of the priorapplication is considered part of and is incorporated by reference inthe disclosure of this application.

TECHNICAL FIELD

The following relates generally to neural networks and more specificallyto training a neural network.

BACKGROUND

A feedforward, artificial neural network uses layers of non-linear“hidden” units between its inputs and its outputs. Each unit has aweight that is determined during learning, which can be referred to as atraining stage. In the training stage, a training set of data (atraining set of inputs each having a known output) is processed by theneural network. Thus, it is intended that the neural network learn howto provide an output for new input data by generalizing the informationit learns in the training stage from the training data. Generally, oncelearning is complete, a validation set is processed by the neuralnetwork to validate the results of learning. Finally, test data (i.e.,data for which generating an output is desired) can be processed by avalidated neural network.

The purpose of learning is to adapt the weights on the incomingconnections of hidden units to learn feature detectors that enable it topredict the correct output when given an input vector. If therelationship between the input and the correct output is complicated andthe network has enough hidden units to model it accurately, there willtypically be many different settings of the weights that can model thetraining set almost perfectly, especially if there is only a limitedamount of labeled training data. Each of these weight vectors will makedifferent predictions on held-out test data and almost all of them willdo worse on the test data than on the training data because the featuredetectors have been tuned to work well together on the training data butnot on the test data.

This occurs because of the overfitting problem, which occurs when theneural network simply memorizes the training data that it is provided,rather than generalizing well to new examples. Generally, theoverfitting problem is increasingly likely to occur as the complexity ofthe neural network increases.

Overfitting can be mitigated by providing the neural network with moretraining data. However, the collection of training data is a laboriousand expensive task.

One proposed approach to reduce the error on the test set is to averagethe predictions produced by many separate trained networks and then toapply each of these networks to the test data, but this iscomputationally expensive during both training and testing.

It is an object of the following to obviate or mitigate at least one ofthe foregoing issues.

SUMMARY

In one aspect, a system for training a neural network is provided, thesystem comprising a switch linked to a plurality of feature detectors ofthe neural network, the switch operable to randomly selectively disableeach of the plurality of feature detectors for each of a plurality oftraining cases.

In another aspect, a method for training a neural network is provided.

DESCRIPTION OF DRAWINGS

The features of the invention will become more apparent in the followingdetailed description in which reference is made to the appended drawingswherein:

FIG. 1 is an architecture diagram of a system for training a neuralnetwork; and

FIG. 2 is a flowchart for training a neural network.

Like reference symbols in the various drawings indicate like elements.

DETAILED DESCRIPTION

Embodiments will now be described with reference to the figures. It willbe appreciated that for simplicity and clarity of illustration, whereconsidered appropriate, reference numerals may be repeated among thefigures to indicate corresponding or analogous elements. In addition,numerous specific details are set forth in order to provide a thoroughunderstanding of the embodiments described herein. However, it will beunderstood by those of ordinary skill in the art that the embodimentsdescribed herein may be practiced without these specific details. Inother instances, well-known methods, procedures and components have notbeen described in detail so as not to obscure the embodiments describedherein. Also, the description is not to be considered as limiting thescope of the embodiments described herein.

It will also be appreciated that any module, unit, component, server,computer, terminal or device exemplified herein that executesinstructions may include or otherwise have access to computer readablemedia such as storage media, computer storage media, or data storagedevices (removable and/or non-removable) such as, for example, magneticdisks, optical disks, or tape. Computer storage media may includevolatile and non-volatile, removable and non-removable media implementedin any method or technology for storage of information, such as computerreadable instructions, data structures, program modules, or other data.Examples of computer storage media include RAM, ROM, EEPROM, flashmemory or other memory technology, CD-ROM, digital versatile disks (DVD)or other optical storage, magnetic cassettes, magnetic tape, magneticdisk storage or other magnetic storage devices, or any other mediumwhich can be used to store the desired information and which can beaccessed by an application, module, or both. Any such computer storagemedia may be part of the device or accessible or connectable thereto.Any application or module herein described may be implemented usingcomputer readable/executable instructions that may be stored orotherwise held by such computer readable media.

It has been found that overfitting may be reduced by selectivelydisabling a randomly (or pseudorandomly) selected subset of featuredetectors in a neural network during each training case of the trainingstage, and adapting the weights of each feature detector accordinglyduring application of the neural network in the test stage. It has beenfound that the foregoing approach may prevent complex co-adaptationsbetween feature detectors, for example where a particular featuredetector is only helpful in the context of several other specificfeature detectors. Although it is preferred that the selective disablingof feature detectors be changed for each training case, it iscontemplated herein that disabling of particular feature detectors maybe held constant for a plurality of training cases.

Referring now to FIG. 1, a feedforward neural network (100) having aplurality of layers (102) is shown. Each layer comprises one or morefeature detectors (104), each of which may be associated with activationfunctions and weights for each parameter input to the respective featuredetector (104). Generally, the output of a feature detectors of layer imay be provided as input to one or more feature detector of layer i+1.

The neural network is implemented by one or more processors. Eachfeature detector may be considered as a processing “node” and one ormore nodes may be implemented by a processor. Further, a memory (106)may be provided for storing activations and learned weights for eachfeature detector. The memory (106) may further store a training setcomprising training data. The training data may, for example, be usedfor image classification in which case the training data may compriseimages with known classifications. The memory (106) may further store avalidation set comprising validation data.

During the training stage, the neural network learns optimal weights foreach feature detector. An optimal configuration can then be applied totest data. Exemplary applications of such a neural network include imageclassification, object recognition and speech recognition.

A switch (108) is linked to at least a subset of the feature detectors.The switch is operable to selectively disable each feature detector inthe neural network to which it is linked, with a learned orpreconfigured probability. A random number generator (110) is linked tothe switch and provides the switch with a random value that enables theswitch to selectively disable each linked feature detector. The possiblevalues generated by the random number generator (110) each correspond toa decision of whether to disable any particular feature detector inaccordance with the preconfigured probability.

In an embodiment, the switch (108) is linked to all feature detectors ofthe hidden layers. In another embodiment, the switch (108) is linked toall feature detectors of the input layers. In yet another embodiment,the switch (108) may be linked to all feature detectors in both thehidden and input layers. In yet further embodiments, the switch (108)may be linked to the feature detectors of a subset of the input andhidden layers. In another aspect, the switch may be connected to allhidden layers that are fully connected layers.

Referring now to FIG. 2, during the training stage, a plurality oftraining cases are input, one at a time, to the neural network in orderto train the neural network. For each such training case, the switchselectively disables a subset of the feature detectors to which it islinked (200). In particular embodiments, the switch is configured todisable each such feature detector in accordance with a preconfiguredprobability. In a more specific embodiment, feature detectors in hiddenlayers may be selectively disabled with probability 0.5 (that is, onaverage, each feature detector will be enabled for half of the trainingcases and disabled for the other half of the training cases) whilefeature detectors of input layers are disabled with probability 0.2(that is, on average, these feature detectors will be enabled for 80% oftraining cases and disabled for 20% of training cases). Therefore, inthis example, for each training case, each hidden layer feature detectoris randomly omitted from the network with a probability of 0.5 and eachinput layer feature detector is randomly omitted from the network with aprobability 0.2, so each hidden or input feature detector cannot rely onother hidden or input feature detectors being present. Thus,co-adaptation of feature detectors may be reduced.

Each training case is then processed by the neural network, one at atime (202). For each such training case, the switch may reconfigure theneural network by selectively disabling each linked feature detector.

Once the training set has been learned by the neural network, the switchmay enable all feature detectors and normalize their outgoing weights(204). Normalization comprises reducing the outgoing weights of eachfeature detector or input by multiplying them by the probability thatthe feature detector or input was not disabled. In an example, if thefeature detectors of each hidden layer were selectively disabled withprobability 0.5 in the training stage, the outgoing weights are halvedfor the test case since approximately twice as many feature detectorswill be enabled. A similar approach is applied to the input layers.

The test set may then be processed by the neural network (206).

It has been found that the foregoing method provides results similar toperforming model averaging with neural networks but is operable to do sowith increased efficiency. The described method may enable the trainingof a plurality of different networks in a reduced time as compared tomodel averaging.

In another aspect, a stochastic gradient descent process may be appliedfor training the neural network on mini-batches of training cases.However, in this example, the penalty term that is normally used toprevent the weights from growing too large may be modified, such thatinstead of penalizing the squared length (L2 norm) of the whole weightvector, an upper bound may be set on the L2 norm of the incoming weightvector for each individual hidden unit. If a weight-update violates thisconstraint, the incoming weights of the hidden unit may be renormalizedby division. Using a constraint rather than a penalty prevents weightsfrom growing very large regardless of how large the proposedweight-update is. Thus, it may be possible to start with a very largelearning rate which decays during learning, thus allowing a thoroughsearch of the weight-space.

Further, performance may be improved by implementing separate L2constraints on the incoming weights of each hidden unit and furtherimproved by also dropping out a random 20% of the pixels.

In further aspects, performance of the neural network on the test setmay be improved by enhancing the training data with transformed imagesor by wiring knowledge about spatial transformations into aconvolutional neural network or by using generative pre-training toextract useful features from the training images without using thelabels, or a combination thereof.

The foregoing method may further be combined with generativepre-training, though it may be beneficial to apply a small learning rateand no weight constraints to avoid losing the feature detectorsdiscovered by the pre-training fine-tuned using standardback-propagation.

In addition, for speech recognition and object recognition datasets thearchitecture of the neural network may be adapted by evaluating theperformance of a plurality of the more optimal learned neural networkson the validation set and then selecting the architecture that performsbest on the validation set as the one to apply to the test set.

In further examples, for datasets in which the required input-outputmapping has several suitably different regimes, performance may befurther improved by adapting the preconfigured probabilities to be alearned function of the input.

In another aspect, the switch may select hidden units in blocks so thatall of the hidden units within a block are always either selected or notselected together. The blocks may comprise units in a single hiddenlayer or may comprise units in more than one hidden layer.

In another aspect, a plurality of switches may be provided to controlblocks of hidden units or inputs, including blocks of size 1, and ahidden unit or input is only used in the forward pass if it is selectedby all of the switches that are capable of selecting it.

Example embodiments are now described for applying the foregoing systemto particular test data. However, it will be appreciated thatalternative neural network configurations may be implemented for suchtest data, and further neural network configurations may be implementedfor other applications. In addition, the type of neural networkimplemented is not limited merely to feedforward neural networks but canalso be applied to any neural networks, including convolutional neuralnetworks, recurrent neural networks, auto-encoders and Boltzmannmachines.

What is claimed is:
 1. A computer-implemented method comprising:obtaining a plurality of training cases; and training a neural networkhaving a plurality of layers on the plurality of training cases, each ofthe layers including one or more feature detectors, each of the featuredetectors having a corresponding set of weights, and a subset of thefeature detectors being associated with respective probabilities ofbeing disabled during processing of each of the training cases, whereintraining the neural network on the plurality of training casescomprises, for each of the training cases respectively: determining oneor more feature detectors to disable during processing of the trainingcase, comprising determining whether to disable each of the featuredetectors in the subset based on the respective probability associatedwith the feature detector, disabling the one or more feature detectorsin accordance with the determining, and processing the training caseusing the neural network with the one or more feature detectors disabledto generate a predicted output for the training case.
 2. The method ofclaim 1, wherein training the neural network further comprises:adjusting the weights of each of feature detectors to generate trainedvalues for each weight in the set of weights corresponding to thefeature detector.
 3. The method of claim 2, further comprising:normalizing the trained weights for each of the feature detectors in thesubset, wherein normalizing the trained weights comprises multiplyingthe trained values of the weights for each of the one or more featuredetectors in the subset by a respective probability of the featuredetector not being disabled during processing of each of the trainingcases.
 4. The method of claim 1, wherein the subset includes featuredetectors in a first layer of the plurality of layers and featuredetectors in one or more second layers of the plurality of layers,wherein the feature detectors in the first layer are associated with afirst probability and wherein the feature detectors in the one or moresecond layers are associated with a second, different probability. 5.The method of claim 4, wherein the first layer is an input layer of theneural network and the one or more second layers are hidden layers ofthe neural network.
 6. The method of claim 4, wherein the first layerand the one or more second layers are hidden layers of the neuralnetwork.
 7. The method of claim 1, wherein determining one or morefeature detectors to disable during processing of the training casecomprises: determining to disable the same feature detectors that weredisabled during processing of a preceding training case.
 8. The methodof claim 1, wherein the neural network is one of a feedforward neuralnetwork, a convolutional neural network, a recurrent neural network, anauto-encoder, or a Boltzmann machine.
 9. A system comprising one or morecomputers and one or more storage devices storing instructions that,when executed by the one or more computers, cause the one or morecomputers to perform operations comprising: obtaining a plurality oftraining cases; and training a neural network having a plurality oflayers on the plurality of training cases, each of the layers includingone or more feature detectors, each of the feature detectors having acorresponding set of weights, and a subset of the feature detectorsbeing associated with respective probabilities of being disabled duringprocessing of each of the training cases, wherein training the neuralnetwork on the plurality of training cases comprises, for each of thetraining cases respectively: determining one or more feature detectorsto disable during processing of the training case, comprisingdetermining whether to disable each of the feature detectors in thesubset based on the respective probability associated with the featuredetector, disabling the one or more feature detectors in accordance withthe determining, and processing the training case using the neuralnetwork with the one or more feature detectors disabled to generate apredicted output for the training case.
 10. The system of claim 9,wherein training the neural network further comprises: adjusting theweights of each of the feature detectors to generate trained values foreach weight in the set of weights corresponding to the feature detector.11. The system of claim 10, the operations further comprising:normalizing the trained weights for each of the feature detectors in thesubset, wherein normalizing the trained weights comprises multiplyingthe trained values of the weights for each of the one or more featuredetectors in the subset by a respective probability of the featuredetector not being disabled during processing of each of the trainingcases.
 12. The system of claim 9, wherein the subset includes featuredetectors in a first layer of the plurality of layers and featuredetectors in one or more second layers of the plurality of layers,wherein the feature detectors in the first layer are associated with afirst probability and wherein the feature detectors in the one or moresecond layers are associated with a second, different probability. 13.The system of claim 12, wherein the first layer is an input layer of theneural network and the one or more second layers are hidden layers ofthe neural network.
 14. The system of claim 12, wherein the first layerand the one or more second layers are hidden layers of the neuralnetwork.
 15. The system of claim 9, wherein determining one or morefeature detectors to disable during processing of the training casecomprises: determining to disable the same feature detectors that weredisabled during processing of a preceding training case.
 16. The systemof claim 9, wherein the neural network is one of a feedforward neuralnetwork, a convolutional neural network, a recurrent neural network, anauto-encoder, or a Boltzmann machine.
 17. A non-transitory computerstorage medium encoded with a computer program, the program comprisinginstructions that when executed by one or more computers cause the oneor more computers to perform operations comprising: obtaining aplurality of training cases; and training a neural network having aplurality of layers on the plurality of training cases, each of thelayers including one or more feature detectors, each of the featuredetectors having a corresponding set of weights, and a subset of thefeature detectors being associated with respective probabilities ofbeing disabled during processing of each of the training cases, whereintraining the neural network on the plurality of training casescomprises, for each of the training cases respectively: determining oneor more feature detectors to disable during processing of the trainingcase, comprising determining whether to disable each of the featuredetectors in the subset based on the respective probability associatedwith the feature detector, disabling the one or more feature detectorsin accordance with the determining, and processing the training caseusing the neural network with the one or more feature detectors disabledto generate a predicted output for the training case.
 18. The computerstorage medium of claim 17, wherein training the neural network furthercomprises: adjusting the weights of each of the feature detectors togenerate trained values for each weight in the set of weightscorresponding to the feature detector.
 19. The computer storage mediumof claim 18, the operations further comprising: normalizing the trainedweights for each of the feature detectors in the subset, whereinnormalizing the trained weights comprises multiplying the trained valuesof the weights for each of the one or more feature detectors in thesubset by a respective probability of the feature detector not beingdisabled during processing of each of the training cases.
 20. Thecomputer storage medium of claim 17, wherein the subset includes featuredetectors in a first layer of the plurality of layers and featuredetectors in one or more second layers of the plurality of layers,wherein the feature detectors in the first layer are associated with afirst probability and wherein the feature detectors in the one or moresecond layers are associated with a second, different probability. 21.The computer storage medium of claim 20, wherein the first layer is aninput layer of the neural network and the one or more second layers arehidden layers of the neural network.
 22. The computer storage medium ofclaim 20, wherein the first layer and the one or more second layers arehidden layers of the neural network.
 23. The computer storage medium ofclaim 17, wherein determining one or more feature detectors to disableduring processing of the training case comprises: determining to disablethe same feature detectors that were disabled during processing of apreceding training case.
 24. The computer storage medium of claim 17,wherein the neural network is one of a feedforward neural network, aconvolutional neural network, a recurrent neural network, anauto-encoder, or a Boltzmann machine.